<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>MVVM</title>
</head>
<body>
<div id="app">
    <h2>{{name}}</h2>
</div>
<!--<script src="../js/vue.js"></script>-->
<script src="./mvvm-master/js/observer.js"></script>
<script src="./mvvm-master/js/compile.js"></script>
<script src="./mvvm-master/js/watcher.js"></script>
<script src="./mvvm-master/js/mvvm.js"></script>
<script>

    //数据代理
    const vm = new MVVM({
        el: "#app",
        data: {
            name: "aa",
        }
    });

    console.log(vm.name, vm); //aa   vm代理对data的读操作
    vm.name = "cc"; //vm代理对data数据的写操作
    console.log(vm._data.name, vm.name); //cc

 /*   let arr = [1,2,3,4];
    for(let i=0;i++;i<arr.length){
        let item = arr[i];

    }*/


</script>
</body>
</html>